<template>
	<view class="container" :style="'min-height:' +pageHei+';'">
		<view class="gui-box" @click="showTextPop = true">
			<text >活动规则</text>
		</view>
		<view class="yao-box">
			<view class="title-yao">
				<view class="code-text">推广码：{{useNum}}</view>
				<image class="img-box" :src="codeImg" mode="widthFix"></image>
			</view>
		</view>
		<u-popup @close="showTextPop = false" :show="showTextPop" closeable mode="center" round="30">
			<view class="pop-box" style="min-width: 700rpx;min-height: 400rpx;">
				<view style="padding:60rpx 30rpx 30rpx 30rpx;max-width: 650rpx;line-height: 46rpx;">
					<u-parse :html="acText"></u-parse>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {getToken} from '@/utils/token.js'
	import {
		selectSysAgreement
	} from '@/common/api/msg.js'
	export default {
		data(){
			return{
				pageHei: '100vh',
				useNum:getToken('useNum'),
				codeImg:'',
				showTextPop:false,
				acText:''
			}
		},
		onLoad: function() {
			uni.getSystemInfo({
				success: (res) => {
					this.pageHei = res.windowHeight * 2 + 'rpx'
				}
			})
			
			if(getToken('version') == 1){
				this.codeImg = 'https://www.ydylmold.cn/images/ydylapp/usrCraftsman/craftsmanHomepageCode/'+(getToken('userInfo').homepageCode)
			}else{
				this.codeImg = 'https://www.ydylmold.cn/images/ydylapp/usrCompany/usrCompanyHomepageCode/'+getToken('complogin').homepageCode
			}
			this.selectSysAgreement()
		},
		methods:{
			selectSysAgreement(){
				selectSysAgreement({moduleNo:'app075'}).then(res=>{
					this.acText = res.data && res.data.data.agreement
				})
			}
		}
	}
</script>

<style lang="scss">
	.container{
		background-image: url('https://job.ydylmold.cn/mingpian/image/me/myTeamInvite-img-One.jpg');
		background-size: 100%;
		background-repeat:no-repeat;
		background-color: #F8F8F8;
		position: relative;
		.gui-box{
			width: 30rpx;
			padding: 20rpx;
			border-radius: 20rpx 0rpx 0rpx 20rpx;
			background-image: linear-gradient(-90deg, #DBB27B, #F5DFC3);
			font-size: 24rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			color: #666;
			position: absolute;
			right: 0;
			top: 100rpx;
		}
		.title-yao{
			position: absolute;
			border-radius: 10rpx;
			bottom: 50rpx;
			width: 86%;
			background-color: #FFFFFF;
			left: 7%;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			padding: 80rpx 0;
			.code-text{
				width: 60%;
				color: #FFFFFF;
				text-align: center;
				background: #0080FF;
				line-height: 80rpx;
				border-radius: 10rpx;
				position: absolute;
				top: -40rpx;
			}
			.img-box{
				width: 350rpx;
			}
		}
	}
</style>
